<html>
<head><meta charset="utf-8"><title>Incredibly weird autoimport bug · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Incredibly.20weird.20autoimport.20bug.html">Incredibly weird autoimport bug</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243997501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Incredibly%20weird%20autoimport%20bug/near/243997501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Incredibly.20weird.20autoimport.20bug.html#243997501">(Jun 26 2021 at 06:11)</a>:</h4>
<p>I think i've just found a really strange bug in RA. For context, i am using <code>rustc_private</code>, i am using llvm-sys aliased to <code>llvm</code> in Cargo.toml. Now, i am trying to get RA to autoimport some things, and its doing it, great. But here comes the ??? part, it is importing it from a package called <code>ammonia</code>, now, ammonia has nothing to do with llvm, it is html sanitization. The weird thing is RA seems to think that it is llvm-sys, it is an impostor llvm-sys. Hovering over it says it is bindings to llvm, and going to definition goes to llvm-sys. So i am guessing this is RA mixing up things. Reloading and cargo cleaning does not fix it either.</p>



<a name="243997545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Incredibly%20weird%20autoimport%20bug/near/243997545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Incredibly.20weird.20autoimport.20bug.html#243997545">(Jun 26 2021 at 06:12)</a>:</h4>
<p>And it didnt swap out the definitions either because using <code>llvm</code> as normal works just fine.</p>



<a name="243997703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Incredibly%20weird%20autoimport%20bug/near/243997703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Incredibly.20weird.20autoimport.20bug.html#243997703">(Jun 26 2021 at 06:17)</a>:</h4>
<p>even stranger!<br>
not aliasing <code>llvm-sys</code> to <code>llvm</code> fixes it</p>



<a name="243997769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Incredibly%20weird%20autoimport%20bug/near/243997769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Incredibly.20weird.20autoimport.20bug.html#243997769">(Jun 26 2021 at 06:18)</a>:</h4>
<p>Here is a minimal reproducible example, have fun! :)<br>
<a href="/user_uploads/4715/mfm-hLy_neERS9cdkVU9chNc/rustanalyzerpls.zip">rustanalyzerpls.zip</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>